//
//  RequestManager.h
//  YCGRICE
//
//  Created by Liu Feng on 2018/7/4.
//  Copyright © 2018年 YeCai. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "GRFileObject.h"

typedef void(^RequestBlock)(BOOL success, id responseObject, GRError *error);

typedef NS_ENUM(NSUInteger, GRMethod) {
    GR_GET = 0,
    GR_POST,
    GR_PUT,
    GR_PATCH,
    GR_DELETE
};

@interface RequestManager : NSObject


/**
 游客身份请求

 @param urlString URL路径
 @param method 请求方式
 @param paramers 参数
 @param completionHandler 回调
 */
+ (void)TouristsRequestWithURLString:(NSString *)urlString
                              Method:(GRMethod  )method
                            Paramers:(NSDictionary *)paramers
                   completionHandler:(RequestBlock)completionHandler;




/**
 会员身份请求

 @param urlString URL路径
 @param method 请求方式
 @param paramers 参数
 @param completionHandler 回调
 */
+ (void)MembershipRequestWithURLString:(NSString *)urlString
                                Method:(GRMethod)method
                              Paramers:(NSDictionary *)paramers
                     completionHandler:(RequestBlock)completionHandler;





/**
 表单请求

 @param urlString URL路径
 @param method 请求方式
 @param paramers 参数
 @param completionHandler 回调
 */
+ (void)MultipartFormRequestWithURLString:(NSString *)urlString
                                   Method:(GRMethod  )method
                                 Paramers:(NSDictionary *)paramers
                        completionHandler:(RequestBlock)completionHandler;





/**
 文件上传（二进制流）

 @param urlString 上传服务器的路径
 @param method 请求方式
 @param fileObjects 文件数组
 @param uploadProgressBlock 上传进度
 @param completionHandler <#completionHandler description#>
 */
+ (void)uploadTaskWithURLString:(NSString *)urlString
                         Method:(GRMethod  )method
                  GRFileObjects:(NSArray
                                 <GRFileObject *> *)fileObjects
                       Progress:(void(^)
                                 (NSProgress *uploadProgress))uploadProgressBlock
              completionHandler:(RequestBlock)completionHandler;




@end
